<?php
/**
* @author: Nguyen.Le
*/
Yii::import('User.models.base.UserProfileBase');
class UserProfile extends UserProfileBase
{
	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
            //array('UserId, Gender, Nationality, MaritalStatus, Birthday, Address1, Mobile', 'required'),
			array('UserId, Gender, Birthday', 'required'),
			array('Birthday', 'type', 'type' => 'date', 'dateFormat' => 'MM/dd/yyyy'),
			array('UserId', 'numerical'),
			array('Nationality', 'length', 'max'=>128),
			array('Address1, Address2, Avatar1, Avatar2, Avatar3', 'length', 'max' => 100),
			array('SocialId, Phone, Mobile, YIM, GoogleIM, Skype', 'length', 'max' => 30),
			array('Avatar1, Avatar2, Avatar3', 'file', 'types' => 'jpg,gif,png,bmp',
														'allowEmpty' => 'true',  
														'maxSize' => Yii::app()->Params['MaxAvatarSize'],
	    												'tooLarge' => Yii::t('User', 'TOO_LARGE_FILE'),
	    												'types' => 'gif,jpg,png,bmp',
	    												'wrongType' => Yii::t('User', 'INVALID_FILE_TYPE')),
		);
	}
	
	public function correctBirthday($attribute, $params)
	{
		
	}	
}
?>
